﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.OS;

namespace GBU.Services.Pedometer
{
    public class StepServiceCallback:ICallback
    {
        private Handler mHandler;

        public StepServiceCallback(Handler mhandler)
        {
            mHandler = mhandler;
        }


        public void StepsChanged(int value)
        {
           // throw new NotImplementedException();
            mHandler.SendMessage(mHandler.ObtainMessage(PedomConst.StepsMsg, value, 0));
        }

        public void PaceChanged(int value)
        {
            mHandler.SendMessage(mHandler.ObtainMessage(PedomConst.PaceMsg, value, 0));
        }

        public void DistanceChanged(float value)
        {
            mHandler.SendMessage(mHandler.ObtainMessage(PedomConst.DistanceMsg, (int)value*1000, 0));
        }

        public void SpeedChanged(float value)
        {
            mHandler.SendMessage(mHandler.ObtainMessage(PedomConst.SpeedMsg, (int)value*1000, 0));
        }

        public void CaloriesChanged(float value)
        {
            mHandler.SendMessage(mHandler.ObtainMessage(PedomConst.CaloriesMsg, (int)value, 0));
        }
    }
}
